1. Field of the Invention
The present invention relates to a compound computer system and, more particularly, to a compound computer system constituted by connecting a plurality of computers, which use a shared resource under exclusive control.
2. Description of the Related Art
In general, in a computer, exclusive control utilizing a semaphore is performed as a synchronous control system executed when a plurality of tasks use a shared resource.
In particular, a binary semaphore, which limits the values to be assumed by a semaphore variable to "0" and "1", is effectively utilized as a technique for realizing a mutual exclusion system for allowing only one task to use a shared resource.
In the exclusive control based on the binary semaphore, a value "1" of the semaphore variable indicates a ready state of a shared resource, and a value "0" of the semaphore variable indicates a busy state of the shared resource. The value of the semaphore variable is increased/decreased in response to P and V operation instructions.
More specifically, a semaphore variable S is checked according to the P operation instruction. If the value of the semaphore variable is "1", the semaphore variable S is set to be "0" by a subtraction (S-1) of -1 from the semaphore variable S. On the other hand, if the value of the semaphore variable is "0", execution of the P operation instruction is interrupted, and a task is queued in a semaphore queue.
In response to the V operation instruction, it is checked if there are tasks that are waiting in a queue. If there are tasks, the first task is set in an execution enable state; otherwise, the semaphore variable S is set to be "1" by an addition (S+1) of +1 to the semaphore variable S.
The V operation instruction is used to inform that a given condition is met, and the P operation instruction is used for waiting until a condition is met. For example, when a specific task in a computer generates a use request to a shared resource, the P operation instruction is issued, and when the use of the shared resource by the specific task ends, the V operation instruction is issued.
However, since the binary semaphore is to perform exclusive control among a plurality of tasks in a single computer, it is difficult to grant exclusive control across a plurality of computers.
More specifically, a binary semaphore mechanism provided in each of a plurality of computers constituting a compound computer system can only perform exclusive control among tasks in the corresponding computer. Therefore, the mechanism cannot queue a task of another computer in its own semaphore queue, or cannot set a task of another computer in an execution enable state according to a V operation instruction.
A technique proposed for exclusive control among a plurality of computers using a semaphore of a specific computer is a technique for preparing a special-purpose task for performing P-V operations for a binary semaphore mechanism as an agent for a request/instruction from a task of another computer.
With this technique, however, the special-purpose task for performing P-V operations as an agent of another computer is operated parallel to a plurality of tasks in the specific computer. Therefore, the special-purpose task itself may be undesirably set in a wait state in a P operation instruction. When the special-purpose task as an agent is set in the wait state in this manner, processing for another computer, i.e., a request/information from another computer cannot be accepted.
The above-mentioned special-purpose task for performing P-V operations may be prepared in the semaphore mechanism of each computer. With this architecture, however, resources such as a CPU, a memory, and the like for task generation are wastefully used, and the performance of the compound computer system is deteriorated.
In this manner, in the conventional system, a special-purpose task must be prepared in a semaphore mechanism of each computer so as to reliably execute exclusive control across a plurality of computers, and computer resources are used in a wasteful manner.